home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / MPW Oberon 2.1168 / OInterfaces / ENET.mod < prev    next >
Encoding:
Text File  |  1995-08-10  |  3.9 KB  |  121 lines  |  [TEXT/MPS ]

  1. (*
  2.      File:        ENET.mod
  3.  
  4.      Contains:    Ethernet Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs.applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. *)
  19.  
  20. (*$TAGS-*)
  21. (*$CALLING PASCAL*)
  22. MODULE ENET;
  23.  
  24. IMPORT SYSTEM, Types, OSUtils;
  25.  
  26. (* $PUSH*)
  27. (* $ALIGN MAC68K*)
  28. (* $LibExport+*)
  29.  
  30. CONST
  31.     ENetSetGeneral*                = 253;                            (*Set "general" mode*)
  32.     ENetGetInfo*                    = 252;                            (*Get info*)
  33.     ENetRdCancel*                = 251;                            (*Cancel read*)
  34.     ENetRead*                    = 250;                            (*Read*)
  35.     ENetWrite*                    = 249;                            (*Write*)
  36.     ENetDetachPH*                = 248;                            (*Detach protocol handler*)
  37.     ENetAttachPH*                = 247;                            (*Attach protocol handler*)
  38.     ENetAddMulti*                = 246;                            (*Add a multicast address*)
  39.     ENetDelMulti*                = 245;                            (*Delete a multicast address*)
  40.     EAddrRType*                    = LONG("eadr");
  41.  
  42.     
  43. TYPE
  44.     EParamBlkPtr* = POINTER TO EParamBlock;
  45.  
  46.     (*
  47.         ENETCompletionProcPtr uses register based parameters on the 68k and cannot
  48.         be written in or called from a high-level language without the help of
  49.         mixed mode or assembly glue.
  50.  
  51.         In*:
  52.          => thePBPtr        A0.L
  53.     *)
  54.     ENETCompletionProcPtr* = Types.Register68kProcPtr;  (* register PROCEDURE ENETCompletion*(thePBPtr: EParamBlkPtr); *)
  55.     ENETCompletionUPP* = Types.UniversalProcPtr;
  56.  
  57.     EParamBlock* = (*ΔΔPACKEDΔΔ*) RECORD
  58.         qLink*:                    OSUtils.QElemPtr (*ΔΔ POINTER TO OSUtils.QElem*);                                    (*General EParams*)
  59.         qType*:                    INTEGER;                                (*queue type*)
  60.         ioTrap*:                    INTEGER;                                (*routine trap*)
  61.         ioCmdAddr*:                Types.Ptr;                                    (*routine address*)
  62.         ioCompletion*:            ENETCompletionUPP;                        (*completion routine*)
  63.         ioResult*:                Types.OSErr;                                    (*result code*)
  64.         ioNamePtr*:                Types.StringPtr;                                (*->filename*)
  65.         ioVRefNum*:                INTEGER;                                (*volume reference or drive number*)
  66.         ioRefNum*:                INTEGER;                                (*driver reference number*)
  67.         csCode*:                    INTEGER;                                (*Call command code*)
  68.         (*ΔΔ CASE INTEGER OF
  69.         0: ( *)
  70.     END;
  71.     ENetWritePB* = RECORD(EParamBlock)
  72.             eProtType*:                    INTEGER;                            (*Ethernet protocol type*)
  73.             ePointer*:                    Types.Ptr;                                (*No support for PowerPC code*)
  74.             eBuffSize*:                    INTEGER;                            (*buffer size*)
  75.             eDataSize*:                    INTEGER;                            (*number of bytes read*)
  76.            (*ΔΔ );
  77.         1: ( *)
  78.     END;
  79.     EMultiAddrPB* = RECORD(EParamBlock)
  80.             eMultiAddr*:                    ARRAY 6 (*ΔΔ[0..5]ΔΔ*) OF CHAR;                (*Multicast Address*)
  81.            (*ΔΔ );*)
  82.     END;
  83.  
  84. CONST
  85.     uppENETCompletionProcInfo* = $00009802; (* Register PROCEDURE (4 bytes in A0); *)
  86.  
  87. PROCEDURE CallENETCompletionProc*(thePBPtr: EParamBlkPtr; userRoutine: ENETCompletionUPP);
  88.     (*$IF NOT GENERATINGCFM*)
  89.     INLINE PASCAL ; (*••*)
  90.     (*To be implemented*:  Glue to move parameters into registers.*)
  91.     (*$END*)
  92.  
  93. PROCEDURE NewENETCompletionProc*(userRoutine: ENETCompletionProcPtr): ENETCompletionUPP;
  94.     (*$IF NOT GENERATINGCFM *)
  95.     INLINE PASCAL $2E9F;
  96.     (*$END*)
  97.  
  98. PROCEDURE EWrite*(thePBptr: EParamBlkPtr; async: BOOLEAN): Types.OSErr;
  99.     EXTERNAL PASCAL;
  100. PROCEDURE EAttachPH*(thePBptr: EParamBlkPtr; async: BOOLEAN): Types.OSErr;
  101.     EXTERNAL PASCAL;
  102. PROCEDURE EDetachPH*(thePBptr: EParamBlkPtr; async: BOOLEAN): Types.OSErr;
  103.     EXTERNAL PASCAL;
  104. PROCEDURE ERead*(thePBptr: EParamBlkPtr; async: BOOLEAN): Types.OSErr;
  105.     EXTERNAL PASCAL;
  106. PROCEDURE ERdCancel*(thePBptr: EParamBlkPtr; async: BOOLEAN): Types.OSErr;
  107.     EXTERNAL PASCAL;
  108. PROCEDURE EGetInfo*(thePBptr: EParamBlkPtr; async: BOOLEAN): Types.OSErr;
  109.     EXTERNAL PASCAL;
  110. PROCEDURE ESetGeneral*(thePBptr: EParamBlkPtr; async: BOOLEAN): Types.OSErr;
  111.     EXTERNAL PASCAL;
  112. PROCEDURE EAddMulti*(thePBptr: EParamBlkPtr; async: BOOLEAN): Types.OSErr;
  113.     EXTERNAL PASCAL;
  114. PROCEDURE EDelMulti*(thePBptr: EParamBlkPtr; async: BOOLEAN): Types.OSErr;
  115.     EXTERNAL PASCAL;
  116.  
  117. (* $ALIGN RESET*)
  118. (* $POP*)
  119.  
  120.  END ENET.
  121.